<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>setInterval</title>

    <script>
        
        console.log( Date.now() );

        // setInterval( codeString , delay  ) // 浏览器支持 
        let t = setInterval( 'console.log( Date.now() )' , 1000 ); 
        console.log( t );

        let count = 1 ;

        function showTime(){
            console.log( 'show time : ' , Date.now() );
            count++ ;
            if( count === 10 ) {
                clearInterval( timer );
            }
        }

        let timer = setInterval( showTime , 1000 );
        console.log( timer );

    </script>

</head>
<body>
    
</body>
</html>